How to merge two databases

Historical one project is in database A and several other projects are in database B.
How can I merge database A in database B?
thsturm - Mon Aug 09 05:52:40 EDT 2010

Re: How to merge two databases
pete.kowalski - Mon Aug 09 11:55:52 EDT 2010

The best, safest way to do this is archive all the projects in one of the databases and restore them in the other.

Re: How to merge two databases
thsturm - Tue Aug 10 02:40:59 EDT 2010

pete.kowalski - Mon Aug 09 11:55:52 EDT 2010
The best, safest way to do this is archive all the projects in one of the databases and restore them in the other.

Yes, this is one part.

What about users, groups, access rights, and shared access to modules?

Have I forgotten something?

Re: How to merge two databases
SystemAdmin - Tue Aug 10 19:14:37 EDT 2010

Archive and Restore might do the job but here are the pitfalls - I could be a bit rusty with this but I'm sure that Louie Landale or Mathias Mamsch will correct me if I'm wrong.

Because the archive will be restored into a different database which may not contain the same users and groups used within the access rights of a project, all specific access rights will be stripped and defaulted to "Inherit from parent". Within a DOORS DB, each user and group is assigned a unique ID which is specific to that DB. Even if you create these users and groups in the other DB, the assigned unique ID most likely be different. I'm not sure if this is still the case if both DB's are using a central LDAP for authentication such as IBM's RDS application.

If the projects being archived have any modules that have traceability columns created by the Analysis Wizard, and the wizard was configured to trace to specific modules, the DXL code generated by the wizard will identify each of the modules involved in the trace by their assigned DB module pointer ID's and not by path\name. When the project is restored into another DB, the DB will assign completely different module pointer ID's and these trace columns will no longer work.


Paul Miller

Re: How to merge two databases
thsturm - Thu Aug 12 08:14:24 EDT 2010

SystemAdmin - Tue Aug 10 19:14:37 EDT 2010
Archive and Restore might do the job but here are the pitfalls - I could be a bit rusty with this but I'm sure that Louie Landale or Mathias Mamsch will correct me if I'm wrong.

Because the archive will be restored into a different database which may not contain the same users and groups used within the access rights of a project, all specific access rights will be stripped and defaulted to "Inherit from parent". Within a DOORS DB, each user and group is assigned a unique ID which is specific to that DB. Even if you create these users and groups in the other DB, the assigned unique ID most likely be different. I'm not sure if this is still the case if both DB's are using a central LDAP for authentication such as IBM's RDS application.

If the projects being archived have any modules that have traceability columns created by the Analysis Wizard, and the wizard was configured to trace to specific modules, the DXL code generated by the wizard will identify each of the modules involved in the trace by their assigned DB module pointer ID's and not by path\name. When the project is restored into another DB, the DB will assign completely different module pointer ID's and these trace columns will no longer work.


Paul Miller

I have done an archive and restore.
Than I run a (self written) "GetPermission.dxl" to generate a "SetPermission.dxl" with the access records of the module with names.

Now I have another problem:

How to set the shareable sections in a module?
Is this possible with DXL?

Re: How to merge two databases
pete.kowalski - Thu Aug 12 11:36:41 EDT 2010

thsturm - Thu Aug 12 08:14:24 EDT 2010
I have done an archive and restore.
Than I run a (self written) "GetPermission.dxl" to generate a "SetPermission.dxl" with the access records of the module with names.

Now I have another problem:

How to set the shareable sections in a module?
Is this possible with DXL?

Yes, it is possible. From memory, you need to use this function "isAccessInherited" to determine if a given object is inherited. If it is ( and the object is at the correct level ), you remove the inheritance which will result in a shareable section.

I have an old script that I can dig up. It is only a few lines of code.

Re: How to merge two databases
thsturm - Mon Aug 16 07:11:59 EDT 2010

pete.kowalski - Thu Aug 12 11:36:41 EDT 2010
Yes, it is possible. From memory, you need to use this function "isAccessInherited" to determine if a given object is inherited. If it is ( and the object is at the correct level ), you remove the inheritance which will result in a shareable section.

I have an old script that I can dig up. It is only a few lines of code.

But if I break the inheritance must I not specify the different access rights?
Or will the access rights the same as the module but only the inheritance-bit is cleared?

Re: How to merge two databases
llandale - Mon Aug 16 18:08:34 EDT 2010

thsturm - Mon Aug 16 07:11:59 EDT 2010
But if I break the inheritance must I not specify the different access rights?
Or will the access rights the same as the module but only the inheritance-bit is cleared?

When you set an object to have "string ErrMess = specific(obj)" rights, its rights are set to those values ..err.. access records it had previously inherited; which come from the parent object which usually sources from the module.

Once 'specific', you can adjust the access records with DXL, perhaps:
string ErrMess = set(obj, RMDC, "ThreeStoogesGroup")
string ErrMess = unset(obj, none, "ThisGroupMustGo")

  • Louie

Re: How to merge two databases
SystemAdmin - Fri Aug 20 08:53:26 EDT 2010

llandale - Mon Aug 16 18:08:34 EDT 2010
When you set an object to have "string ErrMess = specific(obj)" rights, its rights are set to those values ..err.. access records it had previously inherited; which come from the parent object which usually sources from the module.

Once 'specific', you can adjust the access records with DXL, perhaps:
string ErrMess = set(obj, RMDC, "ThreeStoogesGroup")
string ErrMess = unset(obj, none, "ThisGroupMustGo")

  • Louie

A bit specific scenario that I've been thinking of.

Let's assume that in the beginning there was one DOORS DB. The data folder was copied and a new DOORS Server was set up that accessed the copy. Now we have two different DOORS DB's, both of which live happy and long lives... New users added to one or both of the databases, new projects created in the different databases...

Now we want to join the second database into the first again. The database ID's are the same! So a restore of a complete dpa of the second database in the first would assume that it is into the same database as the dpa was created for, and would attempt to restore access as well. Right? But, the users might not exist in the first database, and user ID's might exist in both databases but be two different users...

Is that a correct assumption? If so, you would first have to restore in a database with a different ID, to remove the access rights archive and restore again. Then add/join the users, set up user rights with a custom dxl by exporting and exporting these via a neutral media (like a spreadsheet).

Anyone ever needed to do this? If so... :)

/Kristian

Re: How to merge two databases
Jonny.Stuermer - Mon Dec 20 20:51:05 EST 2010

pete.kowalski wrote:
Yes, it is possible. From memory, you need to use this function "isAccessInherited" to determine if a given object is inherited. If it is ( and the object is at the correct level ), you remove the inheritance which will result in a shareable section.

I have an old script that I can dig up. It is only a few lines of code.

Thanks for your instruction! It's helpful to me, It's very valuable.

Re: How to merge two databases
Dhansoia - Sun Feb 23 21:33:25 EST 2014

thsturm - Thu Aug 12 08:14:24 EDT 2010
I have done an archive and restore.
Than I run a (self written) "GetPermission.dxl" to generate a "SetPermission.dxl" with the access records of the module with names.

Now I have another problem:

How to set the shareable sections in a module?
Is this possible with DXL?

thsturm, I am also in the process of migrating 2 databases to one server. Is it possible for you to share the scripts for getting and restoring project/folder/module permissions. Do you also have a script to migrate users and groups from one database to another.

Re: How to merge two databases
thsturm - Mon Feb 24 03:56:18 EST 2014

Dhansoia - Sun Feb 23 21:33:25 EST 2014

thsturm, I am also in the process of migrating 2 databases to one server. Is it possible for you to share the scripts for getting and restoring project/folder/module permissions. Do you also have a script to migrate users and groups from one database to another.

Sorry, these scripts are gone.

One script, that I use from time to time is "SetInheritProtect.dxl" to unset the shareable of a module.


Attachments

SetInheritProtection.dxl